package com.dx.api;

import com.dx.domain.EmailDto;
import com.dx.factory.RemoteEmailServiceFallbackFactory;
import com.dx.result.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import com.dx.constants.ServiceNameConstants;
import org.springframework.web.bind.annotation.RequestHeader;

@FeignClient(contextId = "remoteEmailService", value = ServiceNameConstants.EMAIL_SERVICE, fallbackFactory = RemoteEmailServiceFallbackFactory.class)
public interface RemoteEmailService {
    @PostMapping("/email/send")
    R<?> sendEmail(@RequestBody EmailDto emailDto, @RequestHeader("sa-token") String token);
}
